// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.11/esri/copyright.txt for details.
//>>built
define("require exports ../../../../../core/tsSupport/declareExtendsHelper ../../../../../core/tsSupport/decorateHelper ../../../../../core/tsSupport/restHelper ../../../../../core/Handles ../../../../../core/watchUtils ../../../../../core/accessorSupport/decorators ./DirectLineMeasurement3DController ./DirectLineMeasurement3DModel ./DirectLineMeasurement3DView ../../../../interactive/InteractiveToolBase ../../../../interactive/interactiveToolUtils".split(" "),
function(q, r, f, c, g, h, k, b, l, m, n, p, d) {
    return function(e) {
        function a(a) {
            var b = e.call(this, a) || this;
            b.manipulators = null;
            b.model = new m({
                sceneView: a.view
            });
            return b
        }
        f(a, e);
        a.prototype.normalizeCtorArgs = function(a) {
            return g(a, ["view"])
        };
        a.prototype.initialize = function() {
            var a = this;
            this._view = new n(this.model);
            this._controller = new l(this.model, this._view);
            this._handles = new h;
            this._handles.add([k.init(this, "state",
            function() {
                "measuring" === a.state ? d.setActive(a, !0) : "measured" === a.state && d.setActive(a, !1)
            },
            !0)])
        };
        a.prototype.destroy = function() {
            this._view.destroy();
            this._view = null;
            this._controller.destroy();
            this._controller = null;
            this._handles.destroy();
            this._handles = null
        };
        Object.defineProperty(a.prototype, "state", {
            get: function() {
                return this.model.isMeasuring ? "measured" === this.model.state ? "measured": "measuring": "ready"
            },
            enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "isSupported", {
            get: function() {
                return "3d" === this.get("view.type")
            },
            enumerable: !0,
            configurable: !0
        });
        Object.defineProperty(a.prototype, "cursor", {
            get: function() {
                return ! this.model.active || "drawing" !== this.model.state && "initial" !== this.model.state ? null: "crosshair"
            },
            enumerable: !0,
            configurable: !0
        });
        a.prototype.show = function() {
            this._view.show()
        };
        a.prototype.hide = function() {
            this._view.hide()
        };
        a.prototype.newMeasurement = function() {
            this.model.reset();
            d.setActive(this, !0)
        };
        a.prototype.clearMeasurement = function() {
            this.model.reset();
			d.setActive(this, !1)
        };
        a.prototype.activate = function() {
            this.model.active = !0
        };
        a.prototype.deactivate = function() {
            this.model.active = !1;
            "measured" !== this.model.state && this.model.reset()
        };
        a.prototype.onAttach = function(a) {
            var b = this._view.createManipulators();
            this._controller.setup(b);
            a.addManipulator(b.start);
            a.addManipulator(b.end);
            this.manipulators = b
        };
        a.prototype.onDetach = function() {
            this.model.reset();
            this.manipulators = null
        };
        a.prototype.onInputEvent = function(a, b) {
			if(a.type != "pointer-move")return;
            this._controller.handleInputEvent(a, this.manipulators, b);
            this.manipulators.start.visible = null != this.model.startPoint;
            this.manipulators.end.visible = null != this.model.endPoint
        };
        c([b.property({
            dependsOn: ["model.isMeasuring", "model.state"],
            readOnly: !0
        })], a.prototype, "state", null);
        c([b.property({
            dependsOn: ["view.type"],
            readOnly: !0
        })], a.prototype, "isSupported", null);
        c([b.property({
            dependsOn: ["model.active", "model.state"],
            readOnly: !0
        })], a.prototype, "cursor", null);
        c([b.property({
            constructOnly: !0
        })], a.prototype, "model", void 0);
        c([b.aliasOf("model.sceneView")], a.prototype, "view", void 0);
        c([b.aliasOf("model.mode")], a.prototype, "mode", void 0);
        c([b.aliasOf("model.unit")], a.prototype, "unit", void 0);
        c([b.aliasOf("model.directDistance")], a.prototype, "directDistance", void 0);
        c([b.aliasOf("model.validMeasurement")], a.prototype, "validMeasurement", void 0);
        c([b.aliasOf("model.horizontalDistance")], a.prototype, "horizontalDistance", void 0);
        c([b.aliasOf("model.verticalDistance")], a.prototype, "verticalDistance", void 0);
        c([b.aliasOf("model.geodesicDistance")], a.prototype, "geodesicDistance", void 0);
        c([b.aliasOf("model.geodesicAngle")], a.prototype, "geodesicAngle", void 0);
        c([b.aliasOf("model.triangleView")], a.prototype, "triangleView", void 0);
        return a = c([b.subclass("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.ShowLaserHeightTool")], a)
    } (b.declared(p))
});